package com.net.xpay.common.dao;

import com.net.xpay.common.domain.User;
import com.net.xpay.common.enums.user.CommissionMode;
import com.net.xpay.common.model.search.UserSearchModel;
import com.net.common.annotation.DataCommon;
import com.net.common.dao.Page;
import com.net.common.dao.VersionedMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@DataCommon
@Repository
public interface UserMapper extends VersionedMapper<Long, User> {
    List<User> search(@Param("searchModel") UserSearchModel searchModel, @Param("page") Page page);

    long searchCount(@Param("searchModel") UserSearchModel searchModel);

    Long countRegister(@Param("partnerId")Long partnerId,@Param("minEndTime") LocalDateTime minEndTime,@Param("maxEndTime") LocalDateTime maxEndTime);

    List<Long> listIds(@Param("searchModel") UserSearchModel searchModel);

    long countUserRegister(@Param("minEndTime") LocalDateTime minEndTime, @Param("maxEndTime") LocalDateTime maxEndTime);

    List<User> listByCommissionMode(@Param("mode") CommissionMode mode);


}
